home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / Dictionary.p < prev    next >
Text File  |  1995-09-12  |  4KB  |  127 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 5:50:35 PM }
  2. {
  3.      File:        Dictionary.p
  4.  
  5.      Contains:    Dictionary Manager Interfaces
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT Dictionary;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __DICTIONARY__}
  26. {$SETC __DICTIONARY__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types, Files;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35. CONST
  36. { Dictionary data insertion modes }
  37.     kInsert                        = 0;                            { Only insert the input entry if there is nothing in the dictionary that matches the key. }
  38.     kReplace                    = 1;                            { Only replace the entries which match the key with the input entry. }
  39.     kInsertOrReplace            = 2;                            { Insert the entry if there is nothing in the dictionary which matches the key. 
  40.                            If there is already matched entries, replace the existing matched entries with the input entry. }
  41.  
  42. { This Was InsertMode }
  43.     
  44. TYPE
  45.     DictionaryDataInsertMode = INTEGER;
  46.  
  47.  
  48. CONST
  49. { Key attribute constants }
  50.     kIsCaseSensitive            = $10;                            { case sensitive = 16        }
  51.     kIsNotDiacriticalSensitive    = $20;                            { diac not sensitive = 32    }
  52.  
  53. { Registered attribute type constants.    }
  54.     kNoun                        = -1;
  55.     kVerb                        = -2;
  56.     kAdjective                    = -3;
  57.     kAdverb                        = -4;
  58.  
  59. { This Was AttributeType }
  60.     
  61. TYPE
  62.     DictionaryEntryAttribute = SInt8;
  63.  
  64. { Dictionary information record }
  65.     DictionaryInformation = RECORD
  66.         dictionaryFSSpec:        FSSpec;
  67.         numberOfRecords:        SInt32;
  68.         currentGarbageSize:        SInt32;
  69.         script:                    ScriptCode;
  70.         maximumKeyLength:        SInt16;
  71.         keyAttributes:            SInt8;
  72.     END;
  73.  
  74.     DictionaryAttributeTable = PACKED RECORD
  75.         datSize:                UInt8;
  76.         datTable:                PACKED ARRAY [0..0] OF DictionaryEntryAttribute;
  77.     END;
  78.  
  79.     DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
  80.  
  81.  
  82. FUNCTION InitializeDictionary({CONST}VAR theFsspecPtr: FSSpec; maximumKeyLength: SInt16; keyAttributes: ByteParameter; script: ScriptCode): OSErr;
  83.     {$IFC NOT GENERATINGCFM}
  84.     INLINE $303C, $0500, $AA53;
  85.     {$ENDC}
  86. FUNCTION OpenDictionary({CONST}VAR theFsspecPtr: FSSpec; accessPermission: ByteParameter; VAR dictionaryReference: SInt32): OSErr;
  87.     {$IFC NOT GENERATINGCFM}
  88.     INLINE $303C, $0501, $AA53;
  89.     {$ENDC}
  90. FUNCTION CloseDictionary(dictionaryReference: SInt32): OSErr;
  91.     {$IFC NOT GENERATINGCFM}
  92.     INLINE $303C, $0202, $AA53;
  93.     {$ENDC}
  94. FUNCTION InsertRecordToDictionary(dictionaryReference: SInt32; key: ConstStr255Param; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr;
  95.     {$IFC NOT GENERATINGCFM}
  96.     INLINE $303C, $0703, $AA53;
  97.     {$ENDC}
  98. FUNCTION DeleteRecordFromDictionary(dictionaryReference: SInt32; key: ConstStr255Param): OSErr;
  99.     {$IFC NOT GENERATINGCFM}
  100.     INLINE $303C, $0404, $AA53;
  101.     {$ENDC}
  102. FUNCTION FindRecordInDictionary(dictionaryReference: SInt32; key: ConstStr255Param; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr;
  103.     {$IFC NOT GENERATINGCFM}
  104.     INLINE $303C, $0805, $AA53;
  105.     {$ENDC}
  106. FUNCTION FindRecordByIndexInDictionary(dictionaryReference: SInt32; recordIndex: SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Str255; recordDataHandle: Handle): OSErr;
  107.     {$IFC NOT GENERATINGCFM}
  108.     INLINE $303C, $0A06, $AA53;
  109.     {$ENDC}
  110. FUNCTION GetDictionaryInformation(dictionaryReference: SInt32; VAR theDictionaryInformation: DictionaryInformation): OSErr;
  111.     {$IFC NOT GENERATINGCFM}
  112.     INLINE $303C, $0407, $AA53;
  113.     {$ENDC}
  114. FUNCTION CompactDictionary(dictionaryReference: SInt32): OSErr;
  115.     {$IFC NOT GENERATINGCFM}
  116.     INLINE $303C, $0208, $AA53;
  117.     {$ENDC}
  118.  
  119. { $ALIGN RESET}
  120. { $POP}
  121.  
  122. {$ENDC} {__DICTIONARY__}
  123.  
  124.  IMPLEMENTATION
  125.  END.
  126.  
  127.